/*
 * 公共表单验证方法
 *
 * @Author: 谢力 843926058@qq.com
 * @Date:   2018-06-06 14:08:51
 * @Last Modified by:   谢力
 * @Last Modified time: 2018-06-06 14:08:56
 *
 *
 * ''required''  			  非空
 * ''ACSII''  				  仅ACSII字符
 * ''number''  				  纯数字，不能包含任何非数字
 * ''integer''  			  正负整数
 * ''negativeInteger''  	  负整数
 * ''positiveInteger''  	  正整数
 * ''float''  				  正负浮点数
 * ''negativeFloat''  		  负浮点数
 * ''positiveFloat''  		  正浮点数
 * ''alphabet''  			  大小写字母
 * ''LETTER''  				  大写字母
 * ''letter''  				  小写字母
 * ''chinese''  			  中文
 * ''color''  				  16进制色值
 * ''date''  				  日期
 * ''card''  				  验证国内银行卡号
 * ''username''  			  用户名
 * ''password''  			  密码
 * ''trueName''  			  真实姓名
 * ''tellphone''  			  手机号码
 * ''phoneNumber''  		  包括验证国内区号,国际区号,分机号
 * ''email''  				  邮箱
 * ''QQ''  					  QQ
 * ''IDcard''  				  身份证
 * ''bankNumber''			  银行卡号
 * ''carNumber''			  车牌号码
 * ''IP''  					  IP地址
 * ''postCode''  			  邮政编码
 * ''img''  				  图片
 * ''file''  				  判断压缩文件
 * ''site'' 				  网址
 * ''ftp''  				  ftp地址
 * ''passport''  			  护照号码
 * ''driver''  				  驾驶证
 * ''ccv''  				  验证CCV
 * ''creditCard''  			  验证信用卡
 * ''usaCreditCard''  		  验证美国信用卡
 * ''usaPostCard''  		  验证美国邮政编码
 */


export const regular = {
    required: /\S+/,
    ACSII: /^[\x00-\xFF]+$/,
    number: /^([+-]?)\d*\.?\d+$/,
    integer: /^-?[1-9]\d*$/,
    negativeInteger: /^-[1-9]\d*$/,
    positiveInteger: /^[0-9]\d*$/,
    float: /^-?(([1-9]\d+|\d)(\.\d{1,})?)$/,
    alphabet: /^[A-Za-z]+$/,
    LETTER: /^[A-Z]+$/,
    letter: /^[a-z]+$/,
    chinese: /^[\u4e00-\u9fa5]+$/,
    color: /^#[a-fA-F0-9]{6}$/,
    date: /^\d{4}(\-|\/|.)\d{1,2}\1\d{1,2}$/,
    username: /^[A-Za-z0-9_\-\u4e00-\u9fa5]+$/,
    password: /^(?![0-9]+$)(?![a-zA-Z]+$)[!"#$%&'()*+,\-.:;<=>?@\[\\\]^_`{|}~A-Za-z0-9]{8,20}$/,
    trueName: /^[?!$%~_#`.·@^\u4e00-\u9fa5]+$/,
    tellphone: /^1[3|4|5|7|8|9][0-9]\d{8}$/,
    phoneNumber: /^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/,
    phoneNumNuoer:/^(13[0-9]|14[5-9]|15[0-3,5-9]|16[2,5,6,7]|17[0-8]|18[0-9]|19[0-3,5-9])\d{8}$/,
    email: /\w+((-w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+/,
    QQ: /^[1-9]*[1-9][0-9]*$/,
    IDcard: {
        name: 'checkIDCard',
        15: /^(\d{6})()?(\d{2})(\d{2})(\d{2})(\d{3})$/,
        18: /^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})([0-9xX])$/
    },
    IP: /((?:(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d?\d))/,
    postCode: /^[0-9]{6}$/,
    img: /(.*)\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$/,
    file: /(.*)\.(rar|zip|7zip|tgz)$/,
    site: /[a-zA-z]+:\/\/[^\s]+/,
    ftp: /ftp\:\/\/[^:]*:@([^\/]*)/,
    passport: /^[0-9]{9}$/,
    driver: /\d{15}$/,
    ccv: /^[0-9]{3}$/,
    creditCard: /^(4\\d{12}(?:\\d{3})?)$/,
    usaCreditCard: /^[3-6]\d{14,15}$/,
    usaPostCard: /^\d{5}$|^\d{9}$/,
}
// @description 排序值验证，排序值不可以大于255
export const validateOrder = function (rule, value, callback) {
}